//
//  CouponGiveCell.m
//  GasBusiness
//
//  Created by zfc on 2021/8/1.
//

#import "CouponGiveCell.h"

@interface CouponGiveCell ()

@end

@implementation CouponGiveCell

- (void)awakeFromNib {
    [super awakeFromNib];

}

- (void)setUI {
    UIView *backView = [[UIView alloc] init];
    backView.backgroundColor = WhiteColor;
    [self.contentView addSubview:backView];
    [backView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.contentView);
        make.leading.top.equalTo(self.contentView);
    }];

    UILabel *lab = [[UILabel alloc] init];
    lab.text = @"请输入手机号码";
    lab.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
    lab.textColor = Color333;
    [backView addSubview:lab];
    [lab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(backView).offset(20);
        make.leading.equalTo(backView).offset(15);
    }];

    UITextField *phoneTf = [[UITextField alloc] init];
    [backView addSubview:phoneTf];
    phoneTf.layer.borderWidth = 0.5;
    phoneTf.leftViewWidth = 10;
    phoneTf.layer.borderColor = ColorCC.CGColor;
    phoneTf.text = @"";
    self.phoneTf = phoneTf;
    [phoneTf mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(lab.mas_bottom).offset(10);
        make.centerX.equalTo(backView);
        make.leading.equalTo(backView).offset(15);
        make.height.mas_equalTo(45);
    }];

    UILabel *lab1 = [[UILabel alloc] init];
    lab1.text = @"请输入赠送数量";
    lab1.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
    lab1.textColor = Color333;
    [backView addSubview:lab1];
    [lab1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(phoneTf.mas_bottom).offset(16);
        make.leading.equalTo(backView).offset(15);
    }];

    UITextField *countTf = [[UITextField alloc] init];
    [backView addSubview:countTf];
    countTf.text = @"";
    countTf.leftViewWidth = 10;
    countTf.layer.borderWidth = 0.5;
    countTf.layer.borderColor = ColorCC.CGColor;
    self.countTf = countTf;
    [countTf mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(lab1.mas_bottom).offset(10);
        make.centerX.equalTo(backView);
        make.leading.equalTo(backView).offset(15);
        make.height.mas_equalTo(45);
    }];

    UIButton *givebtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [givebtn setTitle:@"确认赠送" forState:UIControlStateNormal];
    [givebtn setTitleColor:WhiteColor forState:UIControlStateNormal];
    givebtn.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightBold];
    givebtn.cornerRadius = 5;
    givebtn.backgroundColor = ThemeColor;
    [backView addSubview:givebtn];
    self.givebtn = givebtn;
    [givebtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(backView);
        make.top.equalTo(countTf.mas_bottom).offset(30);
        make.height.mas_equalTo(45);
        make.leading.equalTo(backView).offset(15);
        make.bottom.equalTo(backView).offset(-10);
    }];


}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}

@end
